package com.website.at.fw.dao.ibatis;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.orm.ibatis.SqlMapClientTemplate;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.website.at.fw.dao.IUpdateDao;

/**
 * 更新系用Dao实现
 * 
 * @author kongld
 */
public class UpdateDaoIBatisImpl extends SqlMapClientDaoSupport implements IUpdateDao {

	static Log log = LogFactory.getLog(UpdateDaoIBatisImpl.class);

	@Override
	public int execute(String sqlID, Object bindParams) {
		if (log.isDebugEnabled()) {
			log.debug("execute Start.");
		}
		
		SqlMapClientTemplate sqlMapClientTemplate = getSqlMapClientTemplate();
		int row = sqlMapClientTemplate.update(sqlID, bindParams);

		if (log.isDebugEnabled()) {
			log.debug("execute End. success count:" + row);
		}
		
		return row;
	}
}
